#ifndef SPRITE_H
#define SPRITE_H

#include <SFML/OpenGL.hpp>
#include <SFML/Graphics.hpp>
#include <string>
#include "ScriptManager.h"
#include "TextureManager.h"

                        /** Sprite Class **/
 /*****************************************************************************
 *                                                                            *
 * The Sprite class is a class that uses an sf::Texture and renders it using  *
 * OpenGL you can set the clipRect, position, and Image                       *
 *                                                                            *
 *****************************************************************************/

class Sprite
{
    public:
        Sprite();
        virtual ~Sprite();

        void render();

        void load(std::string filename);
        void load(std::string filename, float x, float y, float clipX, float clipY, float clipW, float clipH);

        void setPosition(float x, float y);
        void setPosition(sf::Vector2f position);
        void move(float x, float y);
        void setClip(float x, float y, float w, float h);
        void setClip(sf::FloatRect clip);
        void setLoaded(bool loaded);

        float x();
        float y();
        float width();
        float height();
        float clipX();
        float clipY();

        sf::Vector2f position();
        sf::FloatRect clip();

    protected:
        TextureManager* _textureMgr;
        sf::Texture  _texture;

        sf::Vector2f _position;
        sf::Vector2f _imageSize;
        sf::FloatRect _clip;
        std::string _fileName;
        ScriptManager* _scriptMgr;
        bool _loaded;

};

#endif // SPRITE_H
